<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{$config_sitename}</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="__CSS__/sspsh.css?t=201512251441" rel="stylesheet">
</head>
<body class="body-pad cl-b-lgrey">
	<div class="loading-wrapper">
		<div class="loading"></div>
	</div>
	<div class="wrapper ssp-wrapper">
		<div class="ub ub-ac page-header">
			<a href="javascript:history.back();" class="clickable"><span class="icon-back"></span></a>
			<div class="ub-f1 page-name">随手拍</div>
			<a href="{:U('Work/search')}" class="clickable">
				<span class="icon-search"></span>
			</a>
		</div>
		<div id="scroll-wrapper">
			<div id="scroller">
			
				<ul id="thelist">
				
				<foreach name="list" item="vo">
				
					<li class="ub cl-b-white clickable ssp-item url-href" data-url="/weixin/suipai/detail?id={$vo.id}">
						<img src="{$vo.uavatar}" class="ssp-tx tx-cir lazy">
						<div class="ub-f1 ssp-cotent">
							<div class="ssp-content-head">
								<p class="cl-f-grey f16">{$vo.title}</p>
								<if condition="$vo.fans eq 1">
								<a href="javascript:;" data-user="{$vo.userid}" class="follow f12 cl-f-xlgrey follow{$vo.userid} active">已关注</a>
								<else/>
								<a href="javascript:;" data-user="{$vo.userid}" class="follow f12 cl-f-xlgrey follow{$vo.userid}">+关注</a>
								</if>
							</div>
							<p class="ssp-content-article cl-f-grey">
								{$vo.content}
							</p>
							<ul class="ssp-content-img" data-pic="{$vo.pic}">
							
							    <foreach name="vo.thumb" item="thumb">
								<li class="lazy wxpicShow" data-original="{$thumb.thumb}" data-pic="{$thumb.pic}"><img src="__IMAGES__/o6.png" class="oimg"></li>
								</foreach>
							</ul>
							<div class="ssp-content-foot ub ub-pj">
								<p class="ssp-content-time cl-f-lgrey">{$vo.create_time}</p>
								<div class="option-wrapper ub">
 								    <div class="like ub ub-pc ub-ac">
 								    	<span class="icon-like"></span><p class="like-text cl-f-orange">0</p>
 								    </div>
									<div class="comment ub ub-pc ub-ac">
								    	<span class="icon-comment"></span><p class="comment-text cl-f-orange">{$vo.msgnum}</p>
								    </div>
								</div>
							</div>
						</div>
					</li>
					
				</foreach>	
				</ul>
			</div>
		</div>
		<div class="add-loading ssp-loading">
		  	<div class="rect1"></div>
		  	<div class="rect2"></div>
		  	<div class="rect3"></div>
		  	<div class="rect4"></div>
		  	<div class="rect5"></div>
		</div>
		<div class="ssp-footer ub ub-pc ub-ac cl-b-white f16 clickable page-footer" onclick="javascript:location.href='/weixin/suipai/add';"><img src="__IMAGES__/icon-cam.png"><span>晒一晒</span></div>
	</div>
	<script src="__JS__/jquery-1.11.1.min.js"></script>
	<script src="__JS__/jquery.lazyload.min.js"></script>
    <script>
    var img_url = "__IMAGES__";
    // 关注
    function follow(userid)
    {
		var $tar = $(".follow"+userid);
		//$tar.toggleClass('active');
		if($tar.hasClass('active')){
			//$tar.text('已关注');
			$.ajax({
			    url: '/weixin/index/cancelfans',
			    type: 'GET',
			    dataType: 'json',
			    data: {
				    userid: userid
			    },
			    success: function(res)
			    {
				    if(res.status == 1)
				    {
				    	$tar.toggleClass('active');
				    	$tar.text('+关注');
				    }
				    else
				    {
					    showToast(res.info);
				    }
			    },
			    error: function(res)
			    {
				    showToast('系统繁忙');
			    }
			});
		}
		else
		{ 
			$.ajax({
			    url: '/weixin/index/addfans',
			    type: 'GET',
			    dataType: 'json',
			    data: {
				    userid: userid
			    },
			    success: function(res)
			    {
			    	if(res.status == 1)
				    {
				    	$tar.toggleClass('active');
				    	$tar.text('已关注');
				    }
				    else
				    {
					    showToast(res.info);
				    }
			    },
			    error: function(res)
			    {
				    showToast('系统繁忙');
			    }
			});
		}
    }
    
    $(function(){
        $('body').on('click', '.url-href', function(e){
            e.preventDefault();
            var url = $(this).attr('data-url');
            location.href = url;
        });

        $('body').on('click', '.follow', function(e){
        	e.preventDefault();
    		e.stopPropagation();
            var userid = $(this).attr('data-user');
            follow(userid);
        });
    });
    var url = "{:U('suipai/splist')}";
    </script>
    <script src="__JS__/custom.js?t=201512251132"></script>
    <script src="__JS__/common.js?t=201512251132"></script>
    <script src="__JS__/suipai.js?t=201512251132"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
    var jsdk = {$jsdk};
    </script>
    <script src="__JS__/wxpic.js?t=201512251402"></script>
</body>
</html>